﻿using MathNet.Numerics.LinearAlgebra.Double;
using System;
using System.Collections.Generic;
using System.Linq;

namespace mathTest
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            var A = DenseMatrix.OfArray(new double[,] {
                                {1,0,0,1,0},
                                {0,1,0,1,0},
                                {0,0,0,1,1},
                                {1,0,1,0,0},
                                {0,1,0,0,1},
                                {1,1,0,0,0}});
            var b = new DenseVector(new double[] { 12.2, 10, 11, 10, 10.5, 10.6 });
            //SolveMatrix(A, b);

            Film1 film = new Film1(0, 0);
            //film.Generate();
            //film.SolveMatrix();

            //var list = Enumerable.Range(1, 50).ToArray();
            //var ans = list.Skip(30).Take(20);
            //ans.

            //foreach (var item in ans)
            //{
            //    Console.WriteLine(item);
            //}

            film.Run();
            Console.ReadLine();
        }

        static public double[] SolveMatrix(DenseMatrix matrix, DenseVector b)
        {
            var res = matrix.Svd().Solve(b).ToArray();

            foreach (var item in res)
            {
                Console.WriteLine(item);
            }
            return res;
        }
    }
}